package com.atde._03_creational_design_patterns.builder.improve;


/**
 * @BelongsProject: hsp_java_design_mode
 * @BelongsPackage: com.atde._03_creational_design_patterns.builder.improve
 * @Author: Del
 * @CreateTime: 2025-06-18  18:42
 * @Description: 建造者模式 --- 指挥者
 * @Version: 1.0
 */
public class HouseDirector {
    BuildHouse buildHouse = null;

    public HouseDirector(BuildHouse buildHouse) {
        this.buildHouse = buildHouse;
    }

    public void setBuildHouse(BuildHouse buildHouse) {
        this.buildHouse = buildHouse;
    }

    // 指挥者，如何构建房子，这个方法在客户端调用
    public House constructHouse() {
        buildHouse.buildBasic();
        buildHouse.buildWalls();
        buildHouse.roofed();
        return buildHouse.buildHouse();
    }
}
